<template>
	<u-tabbar :value="current" zIndex="999" activeColor="#171717" inactiveColor="#171717" :border="false" safeAreaInsetBottom>
		<!-- 首页 -->
		<u-tabbar-item :text="i18n_t('首页')" @click="onClickItem">
			<image class="tabbr-ioc" slot="active-icon" src="@/static/images/tab-bar/1-2.png"></image>
			<image class="tabbr-ioc" slot="inactive-icon" src="@/static/images/tab-bar/1-1.png"></image>
		</u-tabbar-item>
		<!-- 订单 -->
		<u-tabbar-item :text="i18n_t('订单')" @click="onClickItem">
			<image class="tabbr-ioc" slot="active-icon" src="@/static/images/tab-bar/2-2.png"></image>
			<image class="tabbr-ioc" slot="inactive-icon" src="@/static/images/tab-bar/2-1.png"></image>
		</u-tabbar-item>
		<u-tabbar-item :text="i18n_t('秒返')" @click="onClickItem">
			<image class="tabbr-ioc" slot="active-icon" src="@/static/images/tab-bar/3-2.png"></image>
			<image class="tabbr-ioc" slot="inactive-icon" src="@/static/images/tab-bar/3-1.png"></image>
		</u-tabbar-item>

		<!-- 我的 -->
		<u-tabbar-item :text="i18n_t('我的')" @click="onClickItem">
			<image class="tabbr-ioc" slot="active-icon" src="@/static/images/tab-bar/4-2.png"></image>
			<image class="tabbr-ioc" slot="inactive-icon" src="@/static/images/tab-bar/4-1.png"></image>
		</u-tabbar-item>


	</u-tabbar>
</template>

<script>
	export default {
		props: {
			current: {
				type: Number,
				default: 0
			}
		},

		created() {
			uni.hideTabBar() //隐藏底部导航栏
		},
		methods: {

			onClickItem(e) {
				switch (e) {
					case 0:
						uni.switchTab({
							url: '/pages/home/index'
						})
						break;
					case 1:
						uni.switchTab({
							url: '/pages/order/index'
						})
						break;
					case 2:
						uni.switchTab({
							url: '/pages/sec-return/index'
							// url: '/pages/user/index'
						})
						break;
					case 3:
						uni.switchTab({
							url: '/pages/user/index'
						})
						break;
				}
			}
		}

	}
</script>

<style lang="scss" scoped>
	.tabbr-ioc {
		width: 40rpx;
		height: 40rpx;
	}
</style>